﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace BDS3M.Admin.Controls
{
    public partial class ListOrder : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            
                if (!Page.IsPostBack)
                {
                    //Them du lieu vao cat 1

                    rpt_order.DataSource = DAL.DCollector.DBCollector.Instance.StoredProcedureSelectByColumns("tbl_Orders", " Orders_ID,Employee_FullName,DepartureDate,Payment,Orders_CreateDate,Orders_Status ", "selectbycolumns");
                    rpt_order.DataBind();

                }
                  
        }

        protected void rpt_order_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
                if (e.CommandName == "delete")
                {
                    string id = (e.CommandArgument.ToString());
                    DAL.DCollector.DBCollector.Instance.CallStored("callstored", "delete from tbl_Orders where Orders_ID='" + id + "'", false);
                    Response.Redirect("/Admin/Index.aspx?panel=3&sub=0");
                }        
        }
    }
}